<?php
	session_start();
	error_reporting (E_ALL ^ E_NOTICE);
	$accommid = $_POST['accommid'];
	$userid = $_SESSION['user'];
	if ($userid == "")
		echo "You must login to add item to itinerary!";
	else {
		$hostname_conn = "127.0.0.1"; 
		$database_conn = "onestoptravelsgdb";
		$username_conn = "admin";
		$password_conn = "1stoptravel";
		$db_handle = mysql_connect($hostname_conn, $username_conn, $password_conn);
		if (!db_handle) {
			echo "Unable to connect to database.";
		} else {
			$db_found = mysql_select_db($database_conn, $db_handle);
			if ($db_found) {
				$SQL = "INSERT IGNORE INTO tmp_itinerary VALUES ('" . $userid . "', " . $accommid . ");";
				mysql_query($SQL);
				echo "Item added to itinerary.";
			}
		}
		mysql_close($db_handle);
	}
?>